When your panel component is loaded into the settings dialog box and active, you may receive and process dialog events and mouse clicks.
Your component's SGPanelEvent function acts like a modal-dialog filter function, allowing you to process individual dialog events. The sequence grabber calls your SGPanelItem function whenever the user clicks a dialog item.
Whenever the user clicks the OK button, the sequence grabber calls your SGPanelValidateInput function. Your panel component may then validate the user's settings.
Your SGPanelItem function allows your component to receive and process mouse clicks in the settings dialog box.
pascal ComponentResult SGPanelItem (SeqGrabComponent s,
SGChannel c, DialogPtr d,
short itemOffset,
short itemNum);
A sequence grabber component calls your SGPanelItem function whenever the user clicks an item in the settings dialog box. Your component may then perform whatever processing is appropriate, depending upon the item number. Note that the sequence grabber provides an absolute item number. It is your responsibility to adjust this value to account for the offset to your panel's first item in the dialog box.
Your component can filter all dialog events with your SGPanelEvent function. This function is described next.
Sequence grabber components use your component's SGPanelValidateInput function to validate the current input settings as a whole. That function is discussed on SGPanelValidateInput .
Your SGPanelEvent function allows your component to receive and process dialog events. This function is similar to a modal-dialog filter function.
pascal ComponentResult SGPanelEvent (SeqGrabComponent s,
SGChannel c, DialogPtr d,
short itemOffset,
const EventRecord *theEvent,
short *itemHit,
Boolean *handled);
A sequence grabber component calls your SGPanelEvent function whenever an event occurs in the settings dialog box. Your SGPanelEvent function is similar to a modal- dialog filter function. The main difference is that, rather than returning a Boolean value to indicate whether you handled the event, your SGPanelEvent function sets a Boolean value that is provided by the calling function. If you handle the event, be sure to update the field referred to by the itemHit parameter.
Your component can process mouse clicks with your SGPanelItem function. This function is discussed on SGPanelItem .
Sequence grabber components call your component's SGPanelValidateInput function in order to allow you to validate the contents of the user dialog box.
pascal ComponentResult SGPanelValidateInput
(SeqGrabComponent s,
Boolean *ok);
A sequence grabber component calls your SGPanelValidateInput function in order to allow you to validate the settings chosen by the user. This is your opportunity to validate the settings in their entirety, including those for which you may not have received dialog events or mouse clicks. For example, if your panel component uses a TextEdit box, you should validate its contents at this time. Be sure to give the user some indication of what to do to fix the settings.
The sequence grabber calls this function when the user clicks the OK button. If the user clicks the Cancel button, the sequence grabber does not call this function.
You indicate whether the settings are acceptable by setting the Boolean value referred to by the ok parameter. If you set this Boolean value to false , the sequence grabber component ignores the OK button in the dialog box.
Your component can process mouse clicks with your SGPanelItem function, described on SGPanelItem . Your component can filter all dialog events with your SGPanelEvent function, described in the previous section.